__metaclass__ = type

class StdOut:

    def display(self, game, state):
        from checkers import impl
        # Print out the board
        rv = impl.V_RANGE[:]
        rv.reverse()
        hv = impl.H_RANGE[:]
        board = state.board
        for i in rv:
            print '%1s' % i,
            for j in hv:
                piece = board.get((i, j), impl.EMPTY)
                if not impl.queen(piece):
                    piece = piece.lower()
                print '%1s' % piece,
            print ''
        print ' ',
        for j in hv:
            print '%1s' % j,
        print '\n'
